package com.songcha.sakura.ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.just.agentweb.AgentWeb
import com.songcha.library_base.base.BaseFragment
import com.songcha.sakura.databinding.FragmentTestBinding

class TestFragment: BaseFragment() {

    private var binding: FragmentTestBinding? = null

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = FragmentTestBinding.inflate(inflater, container, false)
        val root: View = binding!!.root
        return root
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

         AgentWeb.with(this)
            .setAgentWebParent(binding!!.llAwv, LinearLayout.LayoutParams(-1, -1))
            .closeIndicator()
            .createAgentWeb()
            .ready()
            .go("https://www.baidu.com")
    }
}